/**
 * Copyright 2012 Viettel Telecom. All rights reserved.
 * VIETTEL PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
 */
package my.hnb.android.dto;

import java.io.Serializable;

import android.database.Cursor;


/**
 * Option item dto row
 * 
 * @author: BangHN
 */
@SuppressWarnings("serial")
public class OptionItemDTO implements Serializable{
	public String strText;
	public boolean isSelected = false;
	public int value = 0;

	public OptionItemDTO() {
	}
	
	public OptionItemDTO(OptionItemDTO item) {
		this.strText = item.strText;
		this.isSelected = item.isSelected;
		this.value = item.value;
	}

	public OptionItemDTO(String text) {
		strText = text;
	}
	
	public OptionItemDTO(String text, boolean isSelected) {
		strText = text;
		this.isSelected = isSelected;
	}

	public void setTextMenu(String text) {
		strText = text;
	}

	public void setIsSelected(boolean isSelected) {
		this.isSelected = isSelected;
	}

	public String getTextMenu() {
		return strText;
	}

	public boolean isSelected() {
		return isSelected;
	}

	
	public void setValue(int value){
		this.value = value;
	}
	
	public int getValue(){
		return this.value;
	}
	
	public void parseVolSong(Cursor c) {
		if(c != null){
			value = Integer.parseInt(c.getString(c.getColumnIndex("VOL")));
			strText = "Vol " + value;
			isSelected = true;
		}
	}

	public void parseMusicType(Cursor c) {
		if(c != null){
			value = Integer.parseInt(c.getString(c.getColumnIndex("ID")));
			strText = c.getString(c.getColumnIndex("TEXT"));
			if(value == 4) strText = "Nhạc trẻ";
			isSelected = true;
		}
	}

}
